money = 5000000
name = input("请输入您的姓名")
print(f"{name}，您好，欢迎来到我的ATM")
opt = 0


def main():
    print("请选择你的操作")
    print("查询余额\t[输入1]")
    print("存款\t\t[输入2]")
    print("取款\t\t[输入3]")
    print("退出\t\t[输入4]")
    global opt
    opt = int(input("请输入您的选择\t"))


main()
if opt == 2:
    money1 = int(input("请输入您要存款的金额"))
    money = money + money1
if opt == 3:
    money2 = int(input("请输入您要取出的金额"))
    money += money2
if opt == 4:
    print()


def b():
    if opt == 1:
        print(f"您好，您的余额剩余：{money}")
        main()


b()


def c():
    if opt == 2:
        money3 = int(input("请输入您要存款的数目"))
        global money
        money += money3
        print(f"{name},您好，您存款{money3}元成功")
        print(f"{name},您好，您的余额剩余{money}元")
        main()


c()


def d():
    if opt == 3:
        money4 = int(input("请输入您要取款的数目"))
        global money
        money -= money4
        print(f"{name},您好，您取款{money4}元成功")
        print(f"{name},您好，您的余额剩余{money}元")
        main()


d()
